package org.zxstudio.encrypt;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class EncryptMainActivity extends Activity implements OnClickListener {

	private static final String TAG = "EncryptMainActivity";
	private static final boolean DEBUG = true;

	private Button mTxtBtn;
	private Button mImageBtn;
	private Button mAudioBtn;
	private Button mVideoBtn;
	private Button mSdBtn;
	private Button mMultiMediaBtn;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		initRes();
	}

	private void initRes() {
		mTxtBtn = (Button) findViewById(R.id.txt_encrypt);
		mTxtBtn.setOnClickListener(this);
		mImageBtn = (Button) findViewById(R.id.image_encrypt);
		mImageBtn.setOnClickListener(this);
		mAudioBtn = (Button) findViewById(R.id.audio_encrypt);
		mAudioBtn.setOnClickListener(this);
		mVideoBtn = (Button) findViewById(R.id.video_encrypt);
		mVideoBtn.setOnClickListener(this);
		mSdBtn = (Button) findViewById(R.id.sdcard);
		mSdBtn.setOnClickListener(this);
		mMultiMediaBtn = (Button) findViewById(R.id.mutimedia);
		mMultiMediaBtn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		Intent intent = null;
		if (v.getId() == R.id.sdcard) {
			intent = new Intent(this, TwFileExplorerActivity.class);
		} else if (v.getId() == R.id.mutimedia) {
			intent = new Intent(this, EncryptTabActivity.class);
		} else {
			intent = FileExplorerActivity.createIntent(this, v.getId());
		}

		startActivity(intent);
	}
}